;
(function (window, angular) {
    'use strict';
    angular.module("Controller.Sales", ["Controller.Sales.ClientClass", "Controller.Sales.Client", "Controller.Sales.GuaranteesApply",
            "Controller.Sales.BorrowIn", "Controller.Sales.BorrowBack",
            "Controller.Sales.GuaranteesApplyDetail","Controller.Sales.GuaranteesFeeSettle",
            "Controller.Sales.PurchaseApply", "Controller.Sales.BackApply", "Controller.Sales.ReturnApply",
            "Controller.Sales.SellIntention", "Controller.Sales.SalesDeleted", "Controller.Sales.Allocation",
            "Controller.Sales.DeliveryNotice","Controller.Sales.DeliveryNoticeDel","Controller.Sales.SalesOffset", "Controller.Sales.ThreeOffset",
            "Controller.Sales.DealerLimit", "Controller.Sales.Storefront", "Controller.Sales.ServiceBorrowOut",
            "Controller.Sales.SalesOrderOut", "Controller.Sales.SalesDonateOut", "Controller.Sales.BorrowStatistical", "Controller.Sales.AgentReturn",
            "Controller.BasicData.ClientLevel", "Controller.Sales.SalesOrder", "Controller.Sales.ServiceBorrowIn",
            "Controller.Sales.GuaranteesOut","Controller.Sales.DeptSellOrderMonitor",
            "Controller.Report.ThreeDayPlan", "Controller.Report.SecondClient",
            "Controller.Sales.GiftList","Controller.Sales.GiftManage", "Controller.Sales.GiftExchange", "Controller.Sales.GiftOrder",
            "Controller.Sales.GiftOut","Controller.Sales.SellBusiness", "Controller.Sales.GiftOutInvoice","Controller.Sales.Overdue",
            "Controller.Sales.DealerKeyCatePurchaseCase","Controller.Sales.Dyutask","Controller.Sales.InnerOrder","Controller.Sales.ComplimentaryPur", "Controller.Sales.ContractManage"
        ])
        .config(['$stateProvider', function ($stateProvider) {

            $stateProvider.state("app.sales.clientClass", {
                is18n: true,
                url: "/clientClass",
                templateUrl: "view/sales/clientClass.html",
                controller: "ClientClassCtrl"
            });

            $stateProvider.state("app.sales.client", {
                is18n: true,
                url: "/client",
                templateUrl: "view/sales/client.html",
                controller: "ClientCtrl"
            });

            $stateProvider.state("app.sales.guaranteesApply", {
                url: "/guaranteesApply",
                templateUrl: "view/sales/guaranteesApply.html",
                controller: "GuaranteesApplyCtrl",
                params: {
                    guaApplyDetailVO: undefined
                }
            });

            $stateProvider.state("app.sales.borrowIn", {
                url: "/borrowIn",
                templateUrl: "view/sales/borrowIn.html",
                controller: "BorrowInCtrl"
            });
            $stateProvider.state("app.sales.borrowBack", {
                url: "/borrowBack",
                templateUrl: "view/sales/borrowBack.html",
                controller: "BorrowBackCtrl"
            });

            $stateProvider.state("app.sales.guaranteesApplyDetail", {
                url: "/guaranteesApplyDetail",
                templateUrl: "view/sales/guaranteesApplyDetail.html",
                controller: "GuaranteesApplyDetailCtrl"
            });
            $stateProvider.state("app.sales.GuaranteesFeeSettle", {
                url: "/GuaranteesFeeSettle",
                templateUrl: "view/sales/guaranteesFeeSettle.html",
                controller: "GuaranteesFeeSettleCtrl"
            });
            $stateProvider.state("app.sales.purchaseApply", {
                is18n: true,
                url: "/purchaseApply",
                templateUrl: "view/sales/purchaseApply.html",
                controller: "PurchaseApplyCtrl",
                params: {
                    notReviewedForOneDayCond:false,
                    notEndedForOver1MonthCond:false,
                    purchaseNo: "", //【挖机】发票管理页面点击列表中的采购订单号跳转到采购申请页面，高级搜索参数添加purchaseNo
                }
            });

            $stateProvider.state("app.sales.backApply", {
                url: "/backApply",
                templateUrl: "view/sales/backApply.html",
                controller: "BackApplyCtrl"
            });

            $stateProvider.state("app.sales.returnApply", {
                url: "/returnApply",
                templateUrl: "view/sales/returnApply.html",
                controller: "ReturnApplyCtrl"
            });

            $stateProvider.state("app.sales.salesDeletedList", {
                url: "/salesDeletedList",
                templateUrl: "view/sales/salesDeletedList.html",
                controller: "SalesDeletedListCtrl"
            });

            $stateProvider.state("app.sales.sellIntention", {
                url: "/sellIntention",
                templateUrl: "view/sales/sellIntention.html",
                controller: "SellIntentionCtrl",
                params: {
                    billId: "",
                    billNo: "",
                    saleOrderCountWaitAudit:0, //首页销售订单待审核数量
                    flag: false, // 是否从首页代办事项中的销售订单预警跳转到销售订单页的flag
                    isOrderMonitoring:false, //是否从首页代办事项中的订单监控跳转到销售订单页的flag
                }
            });

            $stateProvider.state("app.sales.deptSellOrderMonitor", {
                url: "/deptSellOrderMonitor",
                templateUrl: "view/sales/deptSellOrderMonitor.html",
                controller: "DeptSellOrderMonitorCtrl",
            });

            $stateProvider.state("app.sales.allocation", {
                url: "/allocation",
                templateUrl: "view/sales/allocation.html",
                controller: "AllocationCtrl"
            });

            $stateProvider.state("app.sales.deliveryNotice", {
                url: "/deliveryNotice",
                templateUrl: "view/sales/deliveryNotice.html",
                controller: "DeliveryNoticeCtrl",
                params: {
                    id: "",
                    flag: false,
                }
            });
            $stateProvider.state("app.sales.deliveryNoticeDel", {
                url: "/deliveryNoticeDel",
                templateUrl: "view/sales/deliveryNoticeDel.html",
                controller: "DeliveryNoticeDelCtrl",
            });
            $stateProvider.state("app.sales.salesOffset", {
                url: "/salesOffset",
                templateUrl: "view/sales/salesOffset.html",
                controller: "SalesOffsetCtrl"
            });

            $stateProvider.state("app.sales.threeOffset", {
                url: "/threeOffset",
                templateUrl: "view/sales/threeOffset.html",
                controller: "ThreeOffsetCtrl"
            });

            $stateProvider.state("app.sales.dealerLimit", {
                url: "/dealerLimit",
                templateUrl: "view/sales/dealerLimit.html ",
                controller: "DealerLimitCtrl"
            });

            $stateProvider.state("app.sales.overdue", {
                url: "/overdue",
                templateUrl: "view/sales/overdue.html",
                controller: "OverdueCtrl"
            });

            $stateProvider.state("app.sales.storefront", {
                url: "/storefront",
                templateUrl: "view/sales/storefront.html",
                controller: "StorefrontCtrl"
            });

            $stateProvider.state("app.sales.clientLevel", {
                is18n: true,
                url: "/clientLevel",
                templateUrl: "view/sales/clientLevel.html",
                controller: "ClientLevelCtrl"
            });

            // add by spd
            $stateProvider.state("app.sales.innerOrder", {
                // is18n: true,
                url: "/innerOrder",
                templateUrl: "view/sales/innerOrder.html",
                controller: "InnerOrderCtrl"
            });
//end

            $stateProvider.state("app.sales.salesOrder", {
                url: "/salesOrder",
                templateUrl: "view/sales/salesOrder.html",
                controller: "SalesOrderCtrl",
                params: {
                    borrowId: ""
                }
            });

            $stateProvider.state("app.sales.serviceBorrowOut", {
                url: "/serviceBorrowOut",
                templateUrl: "view/sales/serviceBorrowOut.html",
                controller: "ServiceBorrowOutCtrl"
            });

            $stateProvider.state("app.sales.borrowStatistical", {
                url: "/borrowStatistical",
                templateUrl: "view/sales/borrowStatistical.html",
                controller: "BorrowStatisticalCtrl"
            });

            $stateProvider.state("app.sales.salesOrderOut", {
                is18n: true,
                url: "/salesOrderOut",
                templateUrl: "view/sales/salesOrderOut.html",
                controller: "SalesOrderOutCtrl",
                params: {
                    billId: ""
                }
            });

            $stateProvider.state("app.sales.salesDonateOut", {
                url: "/salesDonateOut",
                templateUrl: "view/sales/salesDonateOut.html",
                controller: "SalesDonateOutCtrl",
                params: {
                    billId: ""
                }
            });

            $stateProvider.state("app.sales.serviceBorrowIn", {
                url: "/serviceBorrowIn",
                templateUrl: "view/sales/serviceBorrowIn.html",
                controller: "ServiceBorrowInCtrl",
                params: {
                    borrowId: ""
                }
            });

            $stateProvider.state("app.sales.agentReturn", {
                is18n: true,
                url: "/agentReturn",
                templateUrl: "view/sales/agentReturn.html",
                controller: "AgentReturnCtrl",
                params: {
                    returnId: ""
                }
            });

            $stateProvider.state("app.sales.threeDayPlan", {
                url: "/threeDayPlan",
                templateUrl: "view/sales/threeDayPlan.html",
                controller: "ThreeDayPlanCtrl"
            });

            $stateProvider.state("app.sales.secondClient", {
                url: "/secondClient",
                templateUrl: "view/sales/secondClient.html",
                controller: "SecondClientCtrl"
            });

            $stateProvider.state("app.sales.giftList", {
                url: "/giftList",
                templateUrl: "view/sales/giftList.html",
                controller: "GiftListCtrl"
            });

            $stateProvider.state("app.sales.giftManage", {
                url: "/giftManage",
                templateUrl: "view/sales/giftManage.html",
                controller: "GiftManageCtrl"
            });

            $stateProvider.state("app.sales.giftExchange", {
                url: "/giftExchange",
                templateUrl: "view/sales/giftExchange.html",
                controller: "GiftExchangeCtrl"
            });

            $stateProvider.state("app.sales.giftOrder", {
                url: "/giftOrder",
                templateUrl: "view/sales/giftOrder.html",
                controller: "GiftOrderCtrl"
            });

            $stateProvider.state("app.sales.giftOut", {
                url: "/giftOut",
                templateUrl: "view/sales/giftOut.html",
                controller: "GiftOutCtrl"
            });
            $stateProvider.state("app.sales.giftOutInvoice", {
                url: "/giftOutInvoice",
                templateUrl: "view/sales/giftOutInvoice.html",
                controller: "GiftOutInvoiceCtrl"
            });

            $stateProvider.state("app.sales.sellBusiness", {
				url: "/sellBusiness",
				templateUrl: "view/sales/sellBusiness.html",
				controller: "SellBusinessCtrl"
			});

            $stateProvider.state("app.sales.dealerKeyCatePurchaseCase", {
				url: "/dealerKeyCatePurchaseCase",
				templateUrl: "view/sales/dealerKeyCatePurchaseCase.html",
				controller: "DealerKeyCatePurchaseCaseCtrl"
			});
            $stateProvider.state("app.sales.dyutask", {
				url: "/dyutask",
				templateUrl: "view/sales/dyutask.html",
				controller: "DyutaskCtrl"
			});
            $stateProvider.state("app.sales.complimentaryPur", {
                url: "/complimentaryPur",
                templateUrl: "view/sales/complimentaryPur.html",
                controller: "ComplimentaryPurCtrl"
            });

            $stateProvider.state("app.sales.contractManage", {
				url: "/contractManage",
				templateUrl: "view/sales/contractManage.html",
				controller: "ContractManageCtrl"
			});
        }]);
})(window, window.angular);
